package com.itcoon.cloud.framework.temporal;/**
 * @author Athric Yu
 * 2024/11/15
 **/

import org.springframework.core.convert.converter.Converter;

import java.io.Serializable;
import java.time.temporal.Temporal;

/**
 *
 *
 * @author Athric Yu
 * 2024/11/15
 **/
public interface TemporalConvertable<S extends Serializable, T extends Temporal> extends Converter<S, T> {

    T parse(S source);

    S format(T temporal);

    @Override
    default T convert(S source){
       return parse(source);
    }
}
